package com.hx.order.mapper;


import com.hx.order.pojo.Order;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface OrderMapper extends Mapper<Order> {
    /**
     * 查询当前就诊人下的预约信息
     * @param userId
     * @return
     */
    @Results({
            @Result(property = "totalPay",column = "total_pay",jdbcType = JdbcType.BIGINT),
            @Result(property = "createTime",column = "create_time",jdbcType = JdbcType.DATETIMEOFFSET),
            @Result(property = "doctorId",column = "doctor_id",jdbcType = JdbcType.BIGINT)
    })
    @Select("select total_pay,create_time,doctor_id from order_all where type=1 and user_id=#{userId}")
    public List<Order> findByUserId(Long userId);
}
